/**
 * 
 */
package xiaojian.toolkit.transport;

import org.apache.mina.core.session.AttributeKey;
import org.apache.mina.core.session.IoSession;

/**
 * @author hp
 * 
 */
public class TransportUtils extends xiaojian.toolkit.base.TransportUtils {
	private static final AttributeKey TRANSPORT_ENDPOINT = new AttributeKey(
			TransportUtils.class, "TRANSPORT_ENDPOINT");

	public static void attachEndpointToSession(IoSession session,
			Endpoint endpoint) {
		session.setAttribute(TRANSPORT_ENDPOINT, endpoint);
	}

	public static Endpoint getEndpointOfSession(IoSession session) {
		return (Endpoint) session.getAttribute(TRANSPORT_ENDPOINT);
	}
}
